﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="AgilePlannerSchema" targetNamespace="http://schemas.microsoft.com/dsltools/AgilePlanner" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/AgilePlanner" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <!-- Project -->
  <xsd:element name="project" type="Project" />
  <xsd:complexType name="Project">
    <xsd:annotation>
      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: ProjectHasIterations -->
      <xsd:element name="iterations" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of ProjectHasIterations</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded" >
              <xsd:element ref="projectHasIterations">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from ProjectHasIterations needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="iteration" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <!-- Relationship: ProjectHasBacklog -->
      <xsd:element name="backlog" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instance of ProjectHasBacklog</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="1" >
              <xsd:element ref="projectHasBacklog">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from ProjectHasBacklog needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="backlog" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <!-- Id -->
    <xsd:attribute name="Id" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- dslVersion -->
    <xsd:attribute name="dslVersion" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" />
    <!-- Property: PendingColor -->
    <xsd:attribute name="pendingColor" type="xsd:string" />
    <!-- Property: InProgressColor -->
    <xsd:attribute name="inProgressColor" type="xsd:string" />
    <!-- Property: CompletedColor -->
    <xsd:attribute name="completedColor" type="xsd:string" />
    <!-- Property: ColorSchema -->
    <xsd:attribute name="colorSchema" type="ColorSchema" />
    <!-- Property: HighColor -->
    <xsd:attribute name="highColor" type="xsd:string" />
    <!-- Property: MediumColor -->
    <xsd:attribute name="mediumColor" type="xsd:string" />
    <!-- Property: LowColor -->
    <xsd:attribute name="lowColor" type="xsd:string" />
  </xsd:complexType>
  
  <!-- Project Moniker -->
  <xsd:element name="projectMoniker" type="ProjectMoniker" />
  <xsd:complexType name="ProjectMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Project instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Iteration -->
  <xsd:element name="iteration" type="Iteration" substitutionGroup="storyContainer" />
  <xsd:complexType name="Iteration">
    <xsd:complexContent>
      <xsd:extension base="StoryContainer">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: StartDate -->
        <xsd:attribute name="startDate" type="xsd:string" />
        <!-- Property: EndDate -->
        <xsd:attribute name="endDate" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Iteration Moniker -->
  <xsd:element name="iterationMoniker" type="IterationMoniker" substitutionGroup="storyContainerMoniker" />
  <xsd:complexType name="IterationMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Iteration instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="StoryContainerMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Story -->
  <xsd:element name="story" type="Story" />
  <xsd:complexType name="Story">
    <!-- Id -->
    <xsd:attribute name="Id" type="xsd:string">
      <xsd:annotation>
        <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" />
    <!-- Property: Capacity -->
    <xsd:attribute name="capacity" type="xsd:string" />
    <!-- Property: Priority -->
    <xsd:attribute name="priority" type="Priority" />
    <!-- Property: Area -->
    <xsd:attribute name="area" type="xsd:string" />
    <!-- Property: Status -->
    <xsd:attribute name="status" type="Status" />
    <!-- Property: CompleteDate -->
    <xsd:attribute name="completeDate" type="xsd:string" />
    <!-- Property: Description -->
    <xsd:attribute name="description" type="xsd:string" />
  </xsd:complexType>
  
  <!-- Story Moniker -->
  <xsd:element name="storyMoniker" type="StoryMoniker" />
  <xsd:complexType name="StoryMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Story instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:attribute name="Id" type="xsd:string" >
      <xsd:annotation>
        <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
  
  <!-- Backlog -->
  <xsd:element name="backlog" type="Backlog" substitutionGroup="storyContainer" />
  <xsd:complexType name="Backlog">
    <xsd:complexContent>
      <xsd:extension base="StoryContainer">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Backlog Moniker -->
  <xsd:element name="backlogMoniker" type="BacklogMoniker" substitutionGroup="storyContainerMoniker" />
  <xsd:complexType name="BacklogMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for Backlog instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="StoryContainerMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- StoryContainer -->
  <xsd:element name="storyContainer" abstract="true" type="StoryContainer" />
  <xsd:complexType name="StoryContainer" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Relationship: StoryContainerHasStories -->
      <xsd:element name="stories" minOccurs="0" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>Instances of StoryContainerHasStories</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded" >
              <xsd:element ref="storyContainerHasStories">
                <xsd:annotation>
                  <xsd:documentation>[Relationship deriving from StoryContainerHasStories needs to be serialized in full-form]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
              <xsd:element ref="story" >
                <xsd:annotation>
                  <xsd:documentation>[Target role-player]</xsd:documentation>
                </xsd:annotation>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <!-- Property: Name -->
    <xsd:attribute name="name" type="xsd:string" />
  </xsd:complexType>
  
  <!-- StoryContainer Moniker -->
  <xsd:element name="storyContainerMoniker" abstract="true" type="StoryContainerMoniker" />
  <xsd:complexType name="StoryContainerMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for StoryContainer instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ProjectHasIterations -->
  <xsd:element name="projectHasIterations" abstract="true" type="ProjectHasIterations" />
  <xsd:complexType name="ProjectHasIterations" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Iteration -->
      <xsd:element ref="iteration" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ProjectHasIterations Moniker -->
  <xsd:element name="projectHasIterationsMoniker" abstract="true" type="ProjectHasIterationsMoniker" />
  <xsd:complexType name="ProjectHasIterationsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ProjectHasIterations instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- ProjectHasBacklog -->
  <xsd:element name="projectHasBacklog" abstract="true" type="ProjectHasBacklog" />
  <xsd:complexType name="ProjectHasBacklog" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Backlog -->
      <xsd:element ref="backlog" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- ProjectHasBacklog Moniker -->
  <xsd:element name="projectHasBacklogMoniker" abstract="true" type="ProjectHasBacklogMoniker" />
  <xsd:complexType name="ProjectHasBacklogMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for ProjectHasBacklog instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- StoryContainerHasStories -->
  <xsd:element name="storyContainerHasStories" abstract="true" type="StoryContainerHasStories" />
  <xsd:complexType name="StoryContainerHasStories" abstract="true" >
    <xsd:sequence minOccurs="0" maxOccurs="1">
      <!-- Target end Story -->
      <xsd:element ref="story" minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>[Target role-player]</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  
  <!-- StoryContainerHasStories Moniker -->
  <xsd:element name="storyContainerHasStoriesMoniker" abstract="true" type="StoryContainerHasStoriesMoniker" />
  <xsd:complexType name="StoryContainerHasStoriesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for StoryContainerHasStories instance.</xsd:documentation>
    </xsd:annotation>
  </xsd:complexType>
  
  <!-- Enum Priority -->
  <xsd:simpleType name="Priority">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="High"/>
      <xsd:enumeration value="Medium"/>
      <xsd:enumeration value="Low"/>
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- Enum Status -->
  <xsd:simpleType name="Status">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Pending"/>
      <xsd:enumeration value="InProgress"/>
      <xsd:enumeration value="Completed"/>
    </xsd:restriction>
  </xsd:simpleType>
  
  <!-- Enum ColorSchema -->
  <xsd:simpleType name="ColorSchema">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Status"/>
      <xsd:enumeration value="Priority"/>
    </xsd:restriction>
  </xsd:simpleType>
  
</xsd:schema>

